﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using myBoard.Framework.Controls.Navigation;
using Webnet.Controls;

namespace Webnet.BO.ConfigSteps
{
    public class UrlSourceType : StepBase, IBreadcrumbExplorerEntity
    {
        UrlSourceTypeCtrl _urlSourceTypeCtrl;

        public UrlSourceTypeCtrl UrlSourceTypeCtrl
        {
            get { return _urlSourceTypeCtrl; }
            set { _urlSourceTypeCtrl = value; }
        }

        public UrlSourceType()
        {
            _urlSourceTypeCtrl = new UrlSourceTypeCtrl();
            _urlSourceTypeCtrl._saveBt.Click += new System.Windows.RoutedEventHandler(_saveBt_Click);
            _urlSourceTypeCtrl._cancelBt.Click += new System.Windows.RoutedEventHandler(_cancelBt_Click);
        }

        void _cancelBt_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            RaiseWizardCanceled();
        }

        void _saveBt_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Settings.Url = _urlSourceTypeCtrl._urlTbx.Text;
            RaiseWizardCompleted(Settings);
        }

        #region IBreadcrumbExplorerEntity Members

        public void Dispose()
        {
            
        }

        public System.Windows.FrameworkElement GetControl()
        {
            return _urlSourceTypeCtrl;
        }

        public event IBreadcrumbExplorerNextEntitySelectedHandler IBreadcrumbExplorerNextEntitySelected;

        public System.Windows.Media.Imaging.BitmapImage Icon { get; set; }

        public string Name { get; set; }

        public void Update(object newValue)
        {
            
        }

        #endregion
    }
}
